package com.tmx.client;

import tiled.gwt.Map;

import com.google.gwt.user.client.ui.Image;

public class Game {
	
	public Image img;
	public Map map;
	public MapRenderer mapRenderer=new MapRenderer();
	
	public Game(Map map) {
		this.map=map;
		
		this.map.loadImages(this.mapRenderer);
	}
	
	public void resize(int width, int height) {}

	
	float angle=0;
	
	public void render(Screen screen,int refreshRate) {
		

		//mapRenderer.cameraX=(int) (100+100*Math.sin(a));
		//mapRenderer.cameraY=(int) (100+100*Math.cos(a));

		
		screen.clear(600.0f,600.0f,angle);
		//screen.clear();
		
		mapRenderer.setCurrentScreen(screen);
		map.render(mapRenderer);
		
		screen.rotate(600.0f,600.0f,angle);
		
		angle+=0.01f;

    }

}
